<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <pre>
        v-mode指令的作用是便捷设置和获取表单元素的值
        绑定的数据会和表单元素值相关联
        绑定的数据----表单元素的值
    </pre>



    <div id="app">
        <span> {{message}}</span>
        <input type="text" v-model="message" @keyup.enter="getM">
        <button @click="setM">修改message</button>
    </div>
</body>
<script src="../vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            message: "666"
        },
        methods: {

            getM: function () {
                alert(this.message);
            },
            setM: function () {
                this.message = "网抑云";
            }

        }
    })
</script>

</html>